package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.Device;
import com.indusfo.spc.pojo.MaintainPlan;
import org.apache.ibatis.annotations.Param;
import sun.applet.Main;

import java.util.List;

/**
 *@Description 设备保养计划mapper
 *@Author louk
 *@Date 14:29 2019/12/11
*/
public interface MaintainPlanMapper {
    /**
     * 新增设备保养计划
     * @param maintainPlan
     * @return
     */
    int insertMaintainPlan(MaintainPlan maintainPlan);

    /**
     * 审核状态修改
     * @param maintainPlanIds
     * @param auditState
     */
    int auditStateChange(@Param("maintainPlanIds") Integer[] maintainPlanIds, @Param("auditState") Integer auditState);

    /**
     * 数据状态修改
     * @param maintainPlanIds
     * @param dataState
     * @return
     */
    int defineDataState(@Param("maintainPlanIds") Integer[] maintainPlanIds, @Param("dataState") Integer dataState);

    /**
     * 查询设备保养计划
     * @param maintainPlan
     * @return
     */
    List<MaintainPlan> queryMaintainPlanList(@Param("maintainPlan") MaintainPlan maintainPlan,@Param("startDate") String startDate,@Param("endDate") String endDate);

    /**
     * 计数设备保养计划
     * @param maintainPlan
     * @return
     */
    int countMaintainPlanList(@Param("maintainPlan") MaintainPlan maintainPlan,@Param("startDate") String startDate,@Param("endDate") String endDate);

    /**
     * 查询设备保养项目编码
     * @param maintainPlan
     * @return
     */
    int queryPlanNo(MaintainPlan maintainPlan);

    /**
     * 查询选择指定设备保养计划的设备保养作业
     * @param maintainPlanIds
     * @return
     */
    int countMaintainWork(@Param("maintainPlanIds") Integer[] maintainPlanIds);

    List<Integer> queryMaintainPeriod(@Param("maintainPlanIds") Integer[] maintainPlanIds);

    List<Device> queryFilterDevice();

    int deleteByPrimaryKey(Integer maintainPlanId);

    int insert(MaintainPlan record);

    int insertSelective(MaintainPlan record);

    MaintainPlan selectByPrimaryKey(Integer maintainPlanId);

    int updateByPrimaryKeySelective(MaintainPlan record);

    int updateMaintainPlan(MaintainPlan record);
    // 根据设备ID查询
    int selectByDeviceId(@Param("deviceIds") Long[] deviceIds);
}